<template>
  <div>
    <h2>我是孙组件
      <h3>爷爷给我的:{{ car }}</h3>
      <h3>爷爷给我吃的:{{ food }}</h3>
    </h2>
  </div>
</template>

<script setup lang="ts">
import { inject } from 'vue';
let car = inject('car',)
let food = inject('food')


</script>

<style scoped>

</style>